package ltd.newbee.mall.api.admin.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import ltd.newbee.mall.valid.UpdateValid;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@Data
@ToString
@ApiModel(description = "新增权限菜单")
public class AdminPermDto {

    @NotEmpty(message = "菜单名称必填")
    @ApiModelProperty(required = true, name = "name", value = "菜单名称")
    private String name;

    @NotEmpty(message = "权限标识必填")
    @ApiModelProperty(required = true, name = "perm", value = "权限标识")
    private String perm;

    @Pattern(regexp = "^[1-9](\\d+)?$", message = "必须未整数", groups = {UpdateValid.class})
    private Long id;
}
